<form action="<?php echo $this->site['base_url']?>admin_customer_popup/search" method="post">
<table class="form" align="center" cellpadding="3" cellspacing="0">
  <tr>
    <td width="10%"><?php echo Kohana::lang('customer_lang.lbl_name')?>:</td>
    <td><input type="text" name="txt_name" id="txt_name" size="50" value="<?php echo isset($name)?$name:''?>"/></td>
  </tr>
  <tr>
    <td><?php echo Kohana::lang('customer_lang.lbl_address')?>:</td>
    <td><input type="text" name="txt_address" id="txt_address" size="50" value="<?php echo isset($address)?$address:''?>"/></td>
  </tr>
  <tr>
    <td><?php echo Kohana::lang('customer_lang.lbl_phone')?>:</td>
    <td><input type="text" name="txt_phone" id="txt_phone" size="50" value="<?php echo isset($phone)?$phone:''?>"/></td>
  </tr>
  <tr>
    <td colspan="2" style="text-align:center"><button type="submit" name="btn_search" id="btn_search" class="button search" />
      <span><?php echo Kohana::lang('admin_lang.lbl_search')?></span>
      </button></td>
  </tr>
</table>
<?php if(isset($mlist)){ ?>
<table class="list" align="center" cellspacing="1" cellpadding="5">
  <tr class="list_header">
    <td width="50"><?php echo Kohana::lang('admin_lang.lbl_action')?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_first_name')?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_last_name')?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_address')?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_phone')?></td>
    <td><?php echo Kohana::lang('customer_lang.lbl_email')?></td>
  </tr>
  <?php for($i=0; $i<count($mlist); $i++){ ?>
  <tr class="row<?php if($i%2 == 0) echo 2 ?>">
    <?php if(isset($mr['type'])&&$mr['type']=='shipping'){?>
    <td style="text-align:center"><a href="javascript:set_shipping('<?php echo $mlist[$i]['customers_firstname']?>','<?php echo $mlist[$i]['customers_lastname']?>','<?php echo $mlist[$i]['customers_email']?>','<?php echo $mlist[$i]['customers_address']?>','<?php echo $mlist[$i]['customers_address2']?>','<?php echo $mlist[$i]['customers_city']?>','<?php echo $mlist[$i]['customers_state']?>','<?php echo $mlist[$i]['customers_zipcode']?>','<?php echo $mlist[$i]['customers_phone']?>','<?php echo $mlist[$i]['customers_id']?>');"><img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_plus.png" /></a></td>
    <?php } else {?>
    <td style="text-align:center"><a href="javascript:set_billing('<?php echo $mlist[$i]['customers_firstname']?>','<?php echo $mlist[$i]['customers_lastname']?>','<?php echo $mlist[$i]['customers_email']?>','<?php echo $mlist[$i]['customers_address']?>','<?php echo $mlist[$i]['customers_address2']?>','<?php echo $mlist[$i]['customers_city']?>','<?php echo $mlist[$i]['customers_state']?>','<?php echo $mlist[$i]['customers_zipcode']?>','<?php echo $mlist[$i]['customers_phone']?>','<?php echo $mlist[$i]['customers_id']?>');"><img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_plus.png" /></a></td>
    <?php } ?>
    <td><?php echo $mlist[$i]['customers_firstname']?></td>
    <td><?php echo $mlist[$i]['customers_lastname']?></td>
    <td><?php echo $mlist[$i]['customers_address']?></td>
    <td><?php echo $mlist[$i]['customers_phone']?></td>
    <td><?php echo $mlist[$i]['customers_email']?></td>
  </tr>
  <?php } ?>
</table>
<?php } ?>
<input type="hidden" name="hd_type" id="hd_type" value="<?php echo isset($mr['type'])?$mr['type']:''?>" />
</form>
<div class='pagination'><?php echo $this->pagination?></div>
<script language="javascript" runat="server" type="text/javascript" >
function set_billing(firstname,lastname,email,address1,address2,city,state,zipcode,phone,id)
{
	window.opener.get_value(firstname,lastname,email,address1,address2,city,state,zipcode,phone,id);
	window.close();
	return false;
}
function set_shipping(firstname,lastname,email,address1,address2,city,state,zipcode,phone,id)
{
	window.opener.get_value_shipping(firstname,lastname,email,address1,address2,city,state,zipcode,phone,id);
	window.close();
	return false;
}
</script>
